'; window.popUpWin.document.write(zhtm); window.popUpWin.document.close(); // Johnny Jackson 4/28/98 } //--> Inside AutoCAD 14 -- Ch 20 -- Productive Plotting


Inside AutoCAD 14

Previous chapterNext chapterContents


- 20 -

Productive Plotting


by Bill Burchard

The ultimate goal of most AutoCAD drawings is perfecting the final hardcopy output. To reach this goal, contractors use plots to build the project you created in AutoCAD. A good deal of information is available to help you configure your printers and plotters. AutoCAD's Installation Guide, and Autodesk's technical on-demand faxes and online help via their web site, for example, provide a wealth of data. Between this data and that in the manufacturers' guides for printers and plotters, you have the information necessary to properly set up your hardware and software environments.

This chapter does not try to duplicate that information. Instead, the following sections discuss methods for increasing your productivity by using techniques that you can apply to your work regardless of your printer or plotter configuration. By applying the methods and examples presented in this chapter, and by using the associated principles, you will spend less time configuring drawings to be plotted and more time doing productive work.

Specifically, this chapter discusses the following subjects:

Configuring a Plotter

As noted previously, this section does not duplicate the wealth of information already available for configuring printers and plotters. Instead, it discusses methods you should consider when you configure a plotter, to make plotting as easy and intuitive as possible. The specific topics covered here include: naming the configuration, choosing the new network configuration, and configuring for raster plots.

Naming Your Configuration

When you define a new plotter, AutoCAD permits you to name the new configuration with a title containing up to 81 characters. Use a descriptive name, such as the one shown in figure 20.1. This name, HP650c Color Mode - Landscape Orientation, provides enough information to let users know that the configuration is for a Hewlett-Packard HP650c, with color mode selected (as opposed to mono), and with landscape orientation.

Figure 20.1 Use a descriptive name to define plotter configurations.

You can include additional information, such as the paper size for which the plotter configuration is set up, and even the location of the plotter, if your office uses several plotters of the same type.


NOTE: The current printer can be set from the Printer tab in the Preferences dialog box or from the Device and Default Selection dialog box, which is accessed from the Print/Plot Configuration dialog box.

Choosing the New Network Configuration

Release 14 enables you to choose a network printing device, which means that you no longer have to use Autospool to print over a network when you're using AutoCAD's ADI drivers.


NOTE: AutoCAD automatically configures itself for the default system printer. This means that your computer's currently selected default printer, which is chosen from the Windows Printers folder, is the device to which AutoCAD plots.

During the configuration process, AutoCAD asks you to specify the computer port to which the plot should be sent. In earlier releases, the only selections were the Serial port (COM1) or the Parallel port (LPT1). With Release 14, a third choice is available: the Network port (see fig. 20.2).

Figure 20.2 Release 14 offers the new Network port.

Printer settings (such as paper size and orientation) for your computer's default printer can be controlled from the Print Setup window (accessed through the Windows interface) or through AutoCAD's Print/Plot Configuration dialog box. If you use the dialog box, click on the Device and Default Selection button, and then click on the Change button under Device Specific Configuration.


TIP: Use AutoCAD's ADI drivers if they are available for your particular plotters. Autodesk has tested these drivers extensively, and they tend to offer more control over the appearance of your plotted drawings.

Configuring for Raster Plots

A raster image is a bitmap image, which is simply a picture that has been divided into a grid. Each element in the grid represents a single color and is commonly called a pixel (which stands for picture element).

When you configure a plotter with AutoCAD's raster file export driver, AutoCAD prompts you for the grid density. Most of the predefined grid sizes displayed represent those common for computer screens. The standard VGA screen size, for example, is 640*480, which means that the image on the screen is made up of a grid 640 pixels wide by 480 pixels high. Typical AutoCAD computer setups have large screens that allow for denser grids--a common screen grid configuration is 1,024 pixels wide by 768 pixels high.

These densities are fine for computer screens, but might not look very good when plotted. The reason the computer screen density does not work well when plotted is because of the high dots-per-inch (dpi) capability of today's printers. A 600 dpi plotter, for example, is capable of printing 600 pixels in every inch on paper. If you plot a bitmap image that is 640*480 pixels, the printed image will be a little more than one inch wide and less than one inch high. That's not very useful for most poster-size displays.

Of course, you can rescale the bitmap in AutoCAD and stretch it to fill a 24-by-36-inch sheet. The problem with this technique is that the bitmap's pixels also stretch. In this particular case, you would stretch each pixel to a size of about 0.06 inches (1/16 inch) wide by 0.05 inches high. The result would be a very rough--or pixelated--image, as shown in figure 20.3. Certainly, you would not want to use this configuration to display your work.

Figure 20.3 A low-resolution bitmap image provides a poor-quality product.


Using AutoCAD Custom Options for Higher Resolution

Fortunately, AutoCAD provides a custom option for the raster file image. Consequently, you can create your own high-resolution bitmaps that produce very crisp, clear output.

Creating bitmaps with large pixel grids does pose one problem, however; the bitmap's file size is correspondingly larger. When you output your bitmap to a 600 dpi plotter, for example, the highest resolution you can choose would have 600 pixels per inch. Therefore, if you were plotting on a 24-by-36-inch sheet, you could create a bitmap grid 21,600 pixels wide by 14,400 pixels high. Unfortunately, the bitmap file would be about 311 MB in size, and that's a tad large for most machines to handle.


NOTE: To determine the file size of a bitmap image, multiply its width by its height. This gives you a good indication of its size as an 8-bit image (256 colors). To determine the size of a bitmap that is 16 colors (a 4-bit image), multiply its width by its height and then divide that by 2.

Remember not to create a denser pixel grid for your bitmap image than the output device can handle. The extra pixels increase your file's size, but cannot be displayed by the device and will not be used when plotting.

Determining a Bitmap's Pixel Grid Size

When determining a bitmap's pixel grid size, you should determine the grid size based on 100 dpi to 150 dpi. In other words, multiply the width in inches by 100, and the height in inches by 100. This produces the grid density to use. For example, if your bitmap will be plotted on a 24-by-36-inch sheet, use a grid density of 3,600 pixels wide (36 inches times 100 dots-per-inch) by 2,400 pixels high (24 inches times 100 dots-per-inch). The bitmap's file size will be about 8.6 MB. This file size is a little easier to handle than larger files, and the image is still pretty good (see fig. 20.4).

Figure 20.4 An adequate resolution with minimal pixelation can be achieved.

Choosing File and Color Types

When configuring AutoCAD for raster plots, you must select one of the four file types listed. The reason you must select a file type is because AutoCAD does not send raster images directly to the plotter. Instead, it exports the image as a raster file, which you then import and plot from another application. As a consequence, AutoCAD must know what type of raster file format you need. To determine which file type to select, check the software you intend to use for plotting the image, and use the file type recommended there. For most Windows-based applications, the BMP file type is fine.

AutoCAD also gives you a choice of three color types--Mono, 16-color, or 256-color--for your output. The Mono option creates the smallest files, but the bitmap is black-and-white only. The 16-color option creates the next smallest file size and, because most AutoCAD drawings use less than 16 colors, is usually the best setting. If you are creating rendered images, use the 256-color option to produce the most realistic image.

In this section, you learned about configuring AutoCAD for plotting. In the next section, you learn about fine-tuning plotter configurations from AutoCAD's Print/Plot Configuration dialog box.

Setting and Saving Plotter Parameters

With the latest release of AutoCAD, users now have two choices for defining plot parameter files: PCP and PC2. The original Plot Configuration Parameters (PCP) file format remains the same; the only difference is that AutoCAD now refers to this file format as Partial Configuration Parameters. The new PC2 (Complete Configuration Parameters) file not only contains the same information as the original PCP file, but also includes detailed plotter configuration information. In other words, the data you create when you configure a plotter is included in the PC2 file.


TIP: A convenient way to maintain consistent plotter configurations is to include PC2 files with drawing files that you send to another user.

Generally, it is best to define company-wide standards for pen colors and line widths, as well as for plotter setups. In this way, drawings are consistent in every department and you avoid potential problems in plotting when several departments share drawing files.

When you define unique pen colors and line widths for a particular project, save the settings in a PCP/PC2 file and give the file the same name as the drawing. This is useful when, several months later, another CAD technician must create a plot of the project and has to find the correct PCP/PC2 file to load.

The next section discusses how to edit existing PCP files and determine the plot scale.

Quickly Editing PCP Files

Occasionally, you might need to modify an existing PCP or PC2 file. Using AutoCAD to make significant changes to the file can be quite tedious. To change pen settings, for example, you must click on the Pen Assignments button from the Print/Plot Configuration dialog box, and then choose one linetype at a time and modify its values. The process can be frustrating when you must make the same modification to dozens of pens, setting their linetype to 3 or their pen width to 0.10, for example.

Fortunately, both PCP and PC2 files are ASCII text files. Because they can be opened in any word processor or text editor, you can edit them quickly by using Find and Replace operations.

The following exercise demonstrates how to modify a PCP file quickly, using Windows WordPad. Specifically, the linetype values and some of the pen weights are changed.

QUICKLY MODIFYING PCP FILES, ONE BY ONE

1. From the Windows taskbar, choose the Start button. Then choose Programs, Accessories, WordPad to launch the WordPad application.

2. From the File pull-down menu, choose Open to display the Open window.

3. In the File Name text box, enter *.PCP, as shown in figure 20.5, and press Enter. This instructs WordPad to display only files with the PCP extension.

Figure 20.5 When you specify the correct file name in the text box, WordPad returns only PCP files.

4. Open the 20PCP01.PCP file found on the accompanying CD-ROM. The ASCII text file appears.

5. From the Edit pull-down menu, choose Replace to open the Replace window. For the first modification, suppose that you must change the weights of the first 16 pens to 0.10.

6. In the Find what text box, enter PEN_WEIGHT = 0.010000.

7. In the Replace with text box, enter PEN_WEIGHT = 0.10, as shown in figure 20.6.

Figure 20.6 Replacing the Pen Weight values is easy with a Find and Replace operation.


NOTE: The values entered in the Find what and Replace with text boxes must appear exactly like those values in the PCP files, with the exception of trailing zeros.

To quickly and accurately duplicate the values in the PCP file, highlight a line of text that contains the value to be replaced. Next, use Windows' Copy command (Ctrl+C) to copy the value, and then paste it (Ctrl+V) in the text box.


8. Make sure that WordPad's cursor is at the beginning of the text file, and then click on the Replace button. WordPad now goes to the first instance of the matching value.

9. Click on the Replace button again. WordPad changes the highlighted value to match the value in the Replace with text box, and then finds the next instance of a matching value.

10. Repeat this process until the line weights of the first 16 pens have been replaced by the new value. (Keep the file open. You need it for the next exercise.)

In the next exercise you modify the linetype values, replacing all the 0 linetype values with a value of 1.

USING A GLOBAL SEARCH-AND-FIND OPERATION TO MODIFY PCP FILES

1. Press Ctrl+Home to move the cursor to the beginning of the text file.

2. In the Find what text box, enter HW_LINETYPE = 0.

3. In the Replace with text box, enter HW_LINETYPE = 1, as shown in figure 20.7.

Figure 20.7 You're ready to replace the Linetype values with a global Find-and-Replace operation.

4. Click on the Replace All button. WordPad instantly replaces all 0 linetype values with 1. By using this technique, you can quickly modify PCP and PC2 files.


TIP: After you finish editing the file, be sure to save it as a text file--the only type of PCP and PC2 file that AutoCAD recognizes.

This technique can be used with many word processors and text editors, although the commands shown in the preceding exercises are specific to WordPad.

Determining the Plot Scale

Paper space was created to make plotting easier. By creating sheet borders and titles in paper space at a 1:1 scale, and then creating and positioning viewports within the sheet border, you can easily create accurately scaled plots. See the section "Setting Views in Paper Space Viewports" in Chapter 15, "Paper Space," for more detailed information.

In this section, you learned about fine-tuning plotter output by editing PCP and PC2 files. In the next section, you learn about controlling object visibility when plotting.

Hiding Unwanted Objects for Easier Viewing

As a rule, you do not want all objects in a drawing to plot. AutoCAD provides the capability to hide certain objects from view, giving you control over which objects plot. Two methods of hiding objects when plotted are available: Hide Lines and Hideplot. Hide Lines hides objects in model space. Hideplot hides objects in paper space viewports. For more detailed information, see the "Hidden Line Removal: Hide Lines versus Hideplot" section in Chapter 15, "Paper Space."

Using Regions to Hide Objects

In the civil engineering practice, project drawings typically include plans and profiles. The plan views continue from one sheet to the next, and centerline alignments often follow curved paths. When a plan view is continued to the next sheet, it is broken at the current sheet with a matchline. The matchline indicates where the project design stops on the current sheet and continues on the next. For design purposes, the plan view ordinarily is an xref of the entire design model, with only the necessary portion displayed. Until Release 14, it was not easy to hide unwanted objects that extended beyond the matchline. The new XCLIP command solves this problem for xrefs. For more detailed information, see the "Using Release 14's XREF Enhancements" section in Chapter 13, "External References."

The new XCLIP command works only on xrefs and blocks, however. To hide other objects, you still must rely on the tried-and-true methods. The most obvious way to hide unwanted objects is to turn off or freeze the layers on which they reside. This is not always an option, though. When only a portion of an object must be hidden, turning off its layer and hiding the entire object will not work.

One simple way to solve this dilemma is to use the BOUNDARY and REGION commands. The BOUNDARY command quickly creates closed polygons from intersecting objects, and the REGION command transforms these closed polygons into region objects. Region objects behave like solid objects. When they are plotted with the Hide Lines or Hideplot features active, region objects hide any objects that are behind them.

The following exercise demonstrates how to hide objects by using the BOUNDARY and REGION commands.

HIDING OBJECTS WITH THE BOUNDARY AND REGION COMMANDS

1. Open the 20DWG01.DWG drawing file found on the accompanying CD-ROM.


TIP: It's a good idea to use the BOUNDARY command to create regions because this command does not erase the selected objects used to define the region's boundary. The REGION command does delete objects.

2. Create a new layer called Regions and make it current.


Next, you must create the region.

3. From the Draw pull-down menu, choose Boundary to open the Boundary Creation dialog box.


NOTE: The BOUNDARY command is used here to create a new region from the existing green polygon.

4. Choose the Object Type drop-down list, and choose Region.

5. Click on the Make New Boundary Set button.

6. Choose the green polygon, and then press Enter to end the selection process.

7. Click on the Pick Points button.

8. Pick a point inside the green polygon, and then press Enter to end the selection process. AutoCAD creates the new region. In order for the region to hide objects beneath it, the region must be above the objects. Consequently, you must move the region up along its Z axis. This region must be moved to a Z value of 100 because the objects in this drawing have a Z value of 0.

9. Choose the black line that represents the region to activate its grips.

10. Choose one of the grips, and then press Enter to switch the grip edit mode to Move.

11. Enter .XY to filter for the X and Y coordinates.

12. Enter the @ symbol to select the X and Y coordinates of the hot grip.

13. Enter 100 to set the new Z value. This moves the region along its Z axis from 0 to 100.

14. Turn off the Regions layer.

15. Enter HIDE at the Command: prompt. AutoCAD regenerates the screen and hides the objects beneath the region, as shown in figure 20.8. The region hides plotted objects with either the Hide Lines or Hideplot features.

Figure 20.8 Objects are hidden beneath the region object after the HIDE command is issued.


WARNING: Although you can turn off the Regions layer to remove its boundary, you cannot freeze the layer. Freezing the layer also freezes the region, which means that the HIDE command will not work.

If you have objects that you want to display on-screen but that you do not want to have visible when plotted, create a layer called DEFPOINTS on which to place those objects. You can also stop a block from being plotted by placing it on the DEFPOINTS layer, in spite of the internal objects' visibility.


WARNING:[EEND] AutoCAD creates the DEFPOINTS layer when certain objects, such as associative dimensions, are created. Whether this layer is frozen and off or thawed and on, AutoCAD will not plot any objects on the layer.

By hiding unwanted objects, your plotted drawing will show only the objects you need to show. The next section discusses how to plot the mirror image of your drawing.

Plotting Mirrored Drawings

Many times in producing drawings you are required to provide documents for the sole purpose of making blueprints. The drafting trade in the past used semi-clear medias to give the best possible results for these prints. With today's technologies, you often don't have access to many medias beyond vellum and translucent bond. If you want great-looking blueprints, you need to plot your drawing in reverse.

AutoCAD does not have a native mechanism to plot reverse. However, many plotter device controls provide a mirror option for plotting. This feature typically does exist on older devices, but on the newer plotters you can set the plotter so that every plot produced is flipped. This is a valid solution unless this is a shared plotter--not everyone wants their plots reversed.

In order to create plot files that are mirrored by themselves so you don't have to modify the plotter, you need a way of flipping the AutoCAD view.

You can manually flip the entire drawing about the middle and make your plot and undo the change. This is not recommended, however, because dimensions, hatches, leaders, and so on can change appearance when mirrored.

A quick solution that might work for you is the VPOINT command. Normally VPOINT is set to 0,0,1. This means your perspective is from 0,0 in a 0 X distance, 0 Y distance, and 1 in the Z direction--effectively 1 unit above your drawing looking down. Change this to 0,0,-1; now your view is 1 unit below your drawing looking up. Make your plot as needed. When done, set VPOINT back to normal. Changing the drawing perspective is much safer than modifying the drawing objects.


TIP: The VPOINT command is unavailable in paper space, and mirroring drawings in AutoCAD is discouraged.

In this section, you learned how to create a mirrored plot. In the following section, you learn how to quickly plot multiple drawings.

Creating Plots

Creating a single plot from AutoCAD is a simple process. But what about printing dozens, or even hundreds of plots? Fortunately, the process of creating plots is repetitious, and computers excel at performing repetitious tasks. By taking advantage of the repetitive nature of plotting, you can easily automate the process of plotting large numbers of drawings.

Using the New Batch Plot Utility

The latest release of AutoCAD comes with a new stand-alone program called the Batch Plot Utility. With this Visual Basic application, you can easily select multiple drawing files and any associated PC2 or PCP files. The program is easy to use, and you will learn quickly how to have a computer plot multiple files automatically.

One very important feature of this application is that you can save a selection set of drawing files and PC2/PCP files for later use. After you have chosen the appropriate files for plotting, you can save the selection set as a Batch Plot (BPL) file--an ASCII text file that can be viewed by any text editor. The Batch Plot Utility stores the drawing and PC2/PCP file names, along with their paths, in a comma-delimited file (CDF). The format of the file is simple, which makes editing it easy if you need to.

Understanding the Format of a BPL File

To gain an understanding of the BPL format, study the contents of this sample BPL file, which is then explained in the text that follows:

"*BPL*",3,640,480
"D:\ACADR14\SAMPLE\bflyhse.dwg","D:\ACADR14\bflyhse.pc2"
"D:\ACADR14\SAMPLE\bftitle.dwg",""
"D:\ACADR14\SAMPLE\campus.dwg","D:\ACADR14\campus.pcp"

In the first line, the "*BPL*" indicates that this is a Batch Plot Utility file. The 3 is the number of drawings to be plotted, and the 640 and 480 values indicate the screen size of the AutoCAD window in which the file was saved. If you resize this window, the values change accordingly. When the BPL file is opened, the AutoCAD window is resized to the values in the file.

The next three lines list the drawing file names and any associated PC2/PCP files. Notice that the first drawing listed has a PC2 file associated with it. As mentioned earlier, the PC2 file contains PCP file information, as well as information about the plotter to which the drawing is to be sent. The second line lists only a drawing file. When no PC2 or PCP file is associated with the drawing, AutoCAD uses the current plotter and pen settings. The drawing file listed in the last line has a PCP file associated with it. AutoCAD will use this PCP file to determine pen settings but will send the drawing to the current plotter.


TIP: For better control when you're plotting drawings, use a PC2 file instead of a PCP file. The PC2 guarantees that your drawing will be sent to the correct plotter with the appropriate pen settings and therefore will be plotted correctly.

The Batch Plot Utility emulates normal Windows selection methods. To select an entire range of file names, for example, you select the name of the first file and then press and hold the Shift key while you select the last file. Windows chooses the two selected files and all files between them. This feature is convenient for selecting a range of drawing file names to be copied into the Batch Plot Utility text box, and can be used also to associate a PC2 or PCP file to a range of selected drawing files.

The following exercise demonstrates how to associate a single PC2 file to all the drawing files listed in the Batch Plot Utility text box.

ASSOCIATING ONE PC2 FILE WITH A RANGE OF DRAWING FILES

1. Start the Batch Plot Utility. The application should be in the same folder as AutoCAD 14. This launches AutoCAD and opens the AutoCAD Batch Plot Utility window.

2. Click on the Open List button to open the Open Batch Plot List File window.

3. Open the 20BPL01.BPL file found on the accompanying CD-ROM. A list of drawing file names appears in the text box (see fig. 20.9).

Figure 20.9 The list of drawing file names in the Batch Plot Utility.

4. Choose the first file in the list.

5. Scroll down to the end of the list.

6. While you hold down the Shift key, choose the last file in the list. All the drawing file names are highlighted.

7. Click on the Associate PCP/PC2 button.

8. Open the 20PC201.PC2 file found on the accompanying CD-ROM. The Batch Plot Utility associates the 20PC201.PC2 file with all the highlighted files (see fig. 20.10). If you were to start the utility at this point, it would plot all the files shown, using the associated PC2 file.

Figure 20.10 The PC2 file is automatically associated with the drawing file names.

Plotting Different Views with the Batch Plot Utility

One drawback to the Batch Plot Utility application is that, by default, it plots only the drawing's current display. This means that if you want to plot several different areas in the same drawing file, you must make duplicate drawing files and save each view in a different file. Unfortunately, this method uses up disk space and takes time.

A better method is to save the different areas that you want to plot as views. Then follow these steps:

1. Click on the View button in the Print/Plot Configuration dialog box.

2. When the View dialog box opens, choose one of the views.

3. Save the plot setting as a PC2 file. When AutoCAD creates the PC2 file, it saves the current view name.

4. Repeat this process for each saved view.

5. Associate the PC2 files with the drawing in the Batch Plot Utility. The utility will plot all the views from the same drawing.

Using Script Files for Multiple Plots

Script files are commonly used for batch plotting. Although the new Batch Plot Utility is convenient, it is also limited. The technique for plotting different views of a drawing, using PC2 files, works well, but might not meet your needs. The Batch Plot Utility is of no help, for example, if you not only want to plot different views in the same drawing, but also want to turn different layers on and off. Such a task is easy to accomplish with script files, however. Another advantage of script files is that they can be used to execute AutoLISP routines.


TIP: Being able to use script files to execute AutoLISP routines was very useful in a recent company project for which we produced more than 1,100 plan and profile drawings. At the end of the project, when it was time to make our plots, we discovered one problem--a block that was inserted in each drawing was the wrong block, and it had several attribute values. I created an AutoLISP routine that extracted the attribute value from the old block, replaced the old block with the new block, and then filled in the attribute values in the appropriate order. The AutoLISP routine was then inserted in the script file, which also plotted all the drawing files.

When you execute an AutoLISP routine with a script file, the script file stops running. To automatically start the script file again, use the following function and argument as the final function when the routine is exited:

(command "RESUME")


TIP: The RESUME command restarts the script file at the appropriate point. On our company project, and using this technique, we replaced the old block with the new block in each drawing, and plotted the 1,100 drawings automatically.

Another technique used for the same project enabled us to create very quickly a script file containing 1,100 unique drawing file names. By using an ASCII text file created with the new Batch Plot Utility along with Microsoft Excel and Word, we were able to develop in only a few minutes a complicated script file containing hundreds of lines.


The following exercise demonstrates how to set up AutoLISP routines to be executed from script files, as well as how to quickly create large script files.

CREATING A SCRIPT FILE WITH THE BATCH FILE UTILITY AND EXCEL TO PLOT MULTIPLE DRAWINGS

1. Start the Batch Plot Utility, which should be in the same folder as AutoCAD 14. AutoCAD is launched, and the AutoCAD Batch Plot Utility window opens.

2. Open the following list of files, all of which appear in the Batch Plot Utility text box:

3. To save this as a BPL file, first click on the Save List As button. Name the file MYFILE.

4. Close the Batch Plot Utility application.


NOTE: The Batch Plot Utility application is used to quickly create an ASCII text file that contains the drawing file names to be plotted, along with their paths. When plotting with scripts, it's useful to have the drawing file's path. The next step opens the BPL file in Excel 5.0. (If you have a different spreadsheet program, use it. Hopefully, it will have the same tools as Excel.)

5. Launch Excel.

6. Open the MYFILE.BPL file. Excel automatically launches the Import Wizard.

7. Set the file type to Delimited, start the import at row 2, and set the File Origin to Windows (ANSI), as shown in figure 20.11.

Figure 20.11 Set the correct values for the first window in the Text Import Wizard.

8. Click on the Next button.

9. Set the Delimiters to comma and the Text Qualifier to a single quotation mark, as shown in figure 20.12.

Figure 20.12 The correct values for the second window in the Text Import Wizard.

10. Click on the Next button, and then click on the Finish button. Excel inserts the drawing file names into the first row. Next, you must add the AutoCAD commands the script file will execute. In this particular case, the commands will open each drawing, execute an AutoLISP routine, and then save the drawing.

11. Highlight the first column by clicking on the A button at the top of the column.

12. From the Insert pull-down menu, choose Columns. Excel inserts a new column.

13. Select cell A1, and then type the word Open.

14. Move the cursor over the small black dot in the lower-right corner of cell A1 to change the cursor to a small cross.

15. Click and drag down to cell A5. Excel automatically fills all the cells with the word "OPEN."

16. Widen column B by double-clicking the line between the buttons for columns B and C. The cell expands to the width of the text values in column B.

17. Select cell C1. This is where you will enter the name of the AutoLISP routine that will be started from the script. Be sure that the path you type indicates the AutoLISP routine's location on your computer. (The path shown here is just an example.)

18. In cell C1, type the following:

(load "d:\\WORK\\NRP\\R14\\CHAP-20\\DWG\\GETNAME.LSP")

Be sure to separate subdirectories with two back slashes (\\), and remember to include the parentheses. This line of text loads the AutoLISP application. Even though Release 14 has persistent LISP, it's still a good idea to have the script file load the routine each time a new drawing is opened.

19. In cell D1, type GETNAME to execute the AutoLISP routine.

20. In cell E1, type QSAVE to save the drawing.

21. Click and drag the cursor across the three cells, C1, D1, and E1.

22. Move the cursor over the small black dot in the lower-right corner of cell E1 to change the cursor to a small cross.

23. Click and drag down to cell E5. Excel fills the cells with the text. Your spreadsheet should resemble figure 20.13.

Figure 20.13 The script file text appears in the spreadsheet program.

By using AutoCAD's Batch Plot Utility to quickly create a list of drawing file names with their paths, and then importing the file into Excel, you quickly created all the text necessary to plot multiple drawings from a script file. Next, you use Word to change the Excel spreadsheet file into an actual script file that AutoCAD can open and execute.

FINISHING AND RUNNING THE SCRIPT FILE

1. Click and drag across all the cells that contain text to highlight those cells.

2. Choose the Copy button to copy the text to the Windows Clipboard.

3. Launch Microsoft Word.

4. Choose the Paste button.


TIP: The text is pasted into the document as a table. If you cannot see all the table's columns, change the page orientation to Landscape. (Choose Page Setup from the File drop-down menu, choose the Paper Size tab, and select Landscape.)

5. Click and drag inside all the cells to highlight them.

6. From the Table drop-down menu, choose Convert Table to Text, choose Paragraph Marks, and then choose OK. The table text is converted to single lines of text, as shown in figure 20.14.

Figure 20.14 The table text converts to single lines of text in the word processor program.

7. Save the file as Text Only. Name the file MYSCRIPT.SCR, and save it in the ACADR14\SAMPLE directory. Finally, close Word and Excel, without saving the files.


Next, you will open AutoCAD and run the new script file.

8. Start a new AutoCAD drawing. Before you execute the script file, you must disable two dialog boxes.

9. At the Command: prompt, type CMDDIA, and set its value to 0.

10. Next, type FILEDIA, and set its value to 0.


NOTE: If dialog boxes to open files or create plots display during a script, they cause the script to halt. This occurs because a script file cannot pass text to a dialog box. Consequently, you must set the FILEDIA and CMDDIA system variables to 0 (off). When you have finished plotting, set them back to 1 (on). You can set the values of FILEDIA and CMDDIA with the script file.

11. Next, type SCRIPT.

12. When prompted for a script file name, enter ~ (tilde). The Select Script File dialog box opens.

13. Open the MYSCRIPT.SCR script file you just created. (Be sure to close the file in Word first and remember to save it as Text Only.)

The script file executes: It opens each drawing in order and runs the AutoLISP rou-tine, which inserts the drawing's name. This script file can be enhanced to plot each drawing automatically. Additionally, if you associate a PC2 or PCP with each drawing before you save the Batch Plot Utility list file, you can use that information as well.

14. After the script file has finished running, remember to reset the CMDDIA and FILEDIA system variables to 1.

The code in the GETNAME AutoLISP routine follows:

 (defun C:GETNAME (/ DrawingName)
  (setq DrawingName (getvar "DWGNAME"))
  (command "TEXT" "4,4" "0.5" "0" DrawingName)
  (princ)
  (command "RESUME")
)

Notice that the last function in the code is the command function. This function executes the RESUME command, which restarts the script file.

So far, this chapter has discussed several ways you can automate the time- consuming tasks associated with plotting in complex situations. Another way you can use your computer to help automate a challenging task is to set up automated plot-file icons. This process is discussed in the following section.

Setting Up Automated Plot-File Icons

In business practice, it is common for someone to ask for check plots of the work you are doing. Creating a plot of a file you are currently working on is easy. But it's a little more difficult when you haven't worked on a project for several weeks, or even months, and then suddenly discover that (in half an hour) you must give the project manager a plot of the five drawings you worked on three months ago.

This situation can be stressful because you must remember where the files were located, open each one, restore the pen settings (of course you created PC2/PCP files, right?), and then send the correct views to the plotter.

You need to set up a way to easily plot your drawing files--ideally, a way that even the project manager can use. Fortunately, Windows 95 and Windows NT provide a simple way to accomplish this task.

The next exercise demonstrates a viable solution. It details the steps involved in creating a folder on your desktop and tells how to create icons in the folder that can launch AutoCAD automatically, open the appropriate drawing, load the correct PC2/PCP file, and plot the drawing.

CREATING JOB FOLDERS WITH PLOT DRAWING ICONS

1. With your mouse pointer over a blank area of your desktop, right-click. A pop-up menu appears (see fig. 20.15).

Figure 20.15 This pop-up menu is used to create a folder on the desktop.

2. Choose New, and then choose Folder. Windows creates a new folder and places it on the desktop.

3. Enter My Job as the folder's name. The new My Job folder should be on your desktop (see fig. 20.16).

Figure 20.16 The new My Job folder appears on the desktop.

Next, you're going to place copies of the AutoCAD R14 icon in the folder.


NOTE: This next step assumes that you already have the icon on your desktop. If you don't, open Explorer, find the location of the AutoCAD 14 ACAD.EXE file, right-click on it, and drag it over to the desktop.

4. Double-click on the My Job folder to open it.

5. Right-click on the AutoCAD R14 icon, and drag it into the open folder.

6. When prompted, create a shortcut. A copy of the AutoCAD R14 icon should now be in the folder (see fig. 20.17). The icon needs a more descriptive name, so that its task is easily identified.

Figure 20.17 A copy of the AutoCAD R14 icon should appear in the My Job folder.

7. With the AutoCAD R14 icon highlighted, press the F2 key. The icon's title can now be edited.

8. Enter Plot Sheet 1 as the icon's title.


Next, you must modify the properties of the icon. At this point, it is important to understand that you can specify the subdirectory AutoCAD uses as its working directory. And you can assign not only the drawing file that AutoCAD automatically opens, but also a script file that should run automatically when the drawing file is opened.

9. Right-click on the new Plot Sheet 1 icon, and then choose Properties. The Plot Sheet 1 Properties window opens.

10. Select the Shortcut tab.

11. In the Target text box, edit the text to read as follows:

D:\ACADR14\acad.exe 20DWG03 /b 20DWG03

This command line starts AutoCAD, opens the 20DWG03.DWG drawing file, and then runs the 20DWG03.SCR script file.


NOTE: Make sure that both the drawing file and the script file are in the same directory.

12. In the Start in text box, enter the path on which the 20DWG03.DWG and 20DWG03.SCR files reside. Your Shortcut values should be similar to those in figure 20.18.

Figure 20.18 The new Shortcut values for the Plot Sheet 1 icon.

13. Click on OK to save the changes.

Now, when the icon is double-clicked, it will start AutoCAD automatically, open the 20DWG03.DWG drawing file, and run the 20DWG03.SCR script file.

The script file for this exercise contains the following sequence of commands:

;Disable dialog boxes
FILEDIA
0
CMDDIA
0
;Execute PLOT command
PLOT
;Plot Display
D
;Replace configuration from .pc2 file
2
;Enter PC2 file name <D:\WORK\NRP\R14\CHAP-20\DWG\20dwg03>:
20DWG03.PC2
;Accept default for what to plot
;No changes, proceed to Plot
0
;Enable the dialog boxes.
FILEDIA
1
CMDDIA
1
;Quit AutoCAD
QUIT

This script file turns off any dialog boxes that might open, plots the drawing by using the 20DWG03.PC2 file, turns on the dialog boxes again, and then quits AutoCAD.

By using this technique, you can create different folders for projects and provide an easy way for anyone to obtain a plot of a particular drawing.

Summary

In this chapter, you learned about configuring a plotter, naming your configuration, choosing the new network configuration, and configuring for raster plots. PCP files and the new PC2 files were discussed, as was the process of setting and saving plotter parameters with these two file formats. You also learned how to quickly edit these files, and you learned a technique for hiding objects with region objects. This chapter introduced the new Batch Plot Utility and discussed how to use it to plot multiple views. Finally, you learned how to use script files for multiple plots and how to set up automated plot-file icons.

By using the techniques discussed in this chapter, you can quickly create plots of your drawing files, automate the process, and maintain a high level of productivity when plotting.


Previous chapterNext chapterContents

© Copyright, Macmillan Computer Publishing. All rights reserved.